import requests
from lxml.html import fromstring


params = {
  "wd": "中国"
}
headers = {
    'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36'
}

response = requests.get("https://www.amazon.com/gp/offer-listing/B07FCGW6QH", headers=headers)
#
# response = requests.get("https://www.baidu.com/s")
with open('ABC.html','w',encoding="utf-8") as fp:
  fp.write(response.content.decode('utf-8'))

# import re
#
# pattern = re.compile(r'.com/(\d+).html')  # 查找数字
# # result1 = pattern.findall('www.abc.com/index.py?id=123456')
# result1 = pattern.findall('http://product.dangdang.com/27911174.html')
#
# print(result1)
#
# params = {'show_env': '8'}
# headers = {'Connection': 'keep-alive', 'Content-Encoding': 'gzip',
#            'Accept': 'application/json, text/javascript, */*; q=0.01', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36'}
#
#
# response = requests.get("http://product.dangdang.com/index.php?r=callback%2Fdetail&productId=1450610027&templateType=publish&describeMap=0100003100%3A1&shopId=0&categoryPath=01.49.08.14.00.00",
#                         headers=headers)
#
# # response = requests.get("http://product.dangdang.com/index.php?r=callback%2Fdetail&productId=27911174&templateType=publish&describeMap=01000031409%3A1&shopId=0&categoryPath=01.07.07.04.00.00",
# #                         headers=headers)
#
# print(response.text)
# #
# #
#
